
export default {
  namespaced: true,
  state: {
    token: ''
  },
  mutations: {
    settoken(state, token) {
      state.token = token
    },
    logout(state) {
      state.token = ''
    }
  },
  actions: {
    login(context, token) {
      return new Promise(resolve => {
        setTimeout(() => {
          context.commit('settoken', token)
          resolve('登录成功')
        }, 1000)
      })
    }
  }
}
